The head's primary purpose is to serve as the location where the tuning knobs can meet the strings to ensure that the strings are properly wound. Resting on the head are extensions of the tuning knobs; these extensions serve as points where the string can be entered into and then wound.
Also known as tuners, tuning knobs are used to tighten and loosen the strings on your guitar. How tightly wound the string is directly correlates its pitch; the tighter the string, the higher the sound of the note it will produce.
Acoustic guitars have two rows of three pegs which, when the guitar is held as normal, presents one row at the top of the headstock and one row at the bottom. Electric guitars may have tuning pegs in a single row running along the top of the headstock (Fender Stratocaster) or use the the acoustic guitar arrangement (Gibson Les Paul).
All strings pass through a nut at the headstock end of the fretboard. Its function is to maintain correct string spacing and alignment so that the strings feed into their respective tuning pegs. On acoustic guitars the nut and saddle are usually made of the same material. Electric guitars commonly use plastic or synthetic nuts though sometimes metal is used. As tremolo bars can cause tuning problems, guitars equipped with them usually have some manner of locking nut, where the strings are clamped down.